/* -----------------
* brief
* 1. this is code gen by tools
* 2. array like [a,b,c] after each field, define the ui html tag in view,
		a for title,
		b for show or not ,
		c for element html tag , currently support : check、radio、select、input、textarea、upload
* 3. XXX
*/

package tenant

import (
	"github.com/mjiulee/lego"
	"saas_sys_base/common"
)

func init() {
	lego.AddBeanToSynList(new(TenantMember))
}

/* table: "tb_tenant_member"
 * -----------------
 */
type TenantMember struct {
	Id    int64  `xorm:"pk" json:",string"`               // ["id","hide","hidden"]
	IfDel int    `xorm:"default 0"`        // ["deleted","hide","hidden"]
	Cdate string `xorm:"DateTime created"` // ["create","show","datetime"]
	Udate string `xorm:"DateTime updated"` // ["update","show","datetime"]
	// add your custom field here
	TenantId int64 `xorm:"unique(grp_id)" json:",string"` // ["租户ID","show","input"]
	Uid      int64 `xorm:"unique(grp_id)" json:",string"` // ["租户成员ID","show","input"]
	State    int   `xorm:""`                // ["状态","show","select"]
	Role     TENANT_ROLE `xorm:""`
}

const (
	TENANT_MEMBER_STATE_NO = common.STATE_NO
	TENANT_MEMBER_STATE_YES = common.STATE_YES
	TENANT_MEMBER_APPLYING = 3 //正在申请中
)

type TENANT_ROLE int
const (
	TENANT_ROLE_SUPER_ADMIN TENANT_ROLE = 1
	TENANT_ROLE_EMPLOYEE TENANT_ROLE = 2
)